#pragma once
#include "adapt_data.pb.h"
#include <vector>
#include <map>
#include <string>

using namespace std;

int64_t get_current_datetime();

class CStock
{
public:
	CStock(string strCode,bool bKcb);
	~CStock();
	bool Decode(char* pszLine, std::shared_ptr<class TcpClient> hq_prt);
	bool DecodeValue(float fValueData[32], std::shared_ptr<class TcpClient> hq_prt);
public:
	int  cur_volumn_;
	int  total_volumn_;
	float cur_price_;
private:
	string  strCode_;
	int      stock_code_id_;
	string  strName_;
	bool   bKCB_;
	adapter::pb::YusurHqdata  cur_hq_data_;
	char* payload_send_buffer_;
};


class CStockManager 
{
public:
	CStockManager();
	~CStockManager();
public:
	void AddStock(string strCode, CStock* pStock);
	CStock* GetStock(string strCode);
private:
	map<string, CStock*> stock_manager_map_;
};